<template>
  <div>
    <div class="img" ref="acg_img">
    </div>
    <div class="font">
      <h1>404</h1>
      <h1>Not Find</h1>
    </div>
    <div class="bottom">
      {{hitokoto}}
    </div>
  </div>
</template>
<script>
export default {
  name:"NotFind",
  created() {
    this.get_hitokoto();
    this.get_agc();
  },
  data() {
    return {
      hitokoto:"数据请求中...",
      acg_url:""
    }
  },
  methods:{
    async get_hitokoto(){
      let {data} = await this.$http.get("/get_hitokoto");
      this.hitokoto = data.hitokoto;
    },
    async get_agc(){
      let {data} = await this.$http.get("/get_acg");
      console.log(data.url);
      this.acg_url = data.url

      this.$refs.acg_img.style.background = `url(${data.url}) no-repeat center center`;
      // this.$refs.acg_img.style.backgroundPosition = ``;
    }
  }
}
</script>
<style lang="less" scoped>
  .img{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    // background: url(https://file.alapi.cn/image/comic/Test/0072Vf1pgy1foxlofvhqoj31hc0u0qhu.jpg!/both/500x200) no-repeat ;
    // background-position: center center;
    background-size: cover;
    filter: blur(0px);
  }
  .font{
    position: absolute;
    font-size: 0.2rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    h1{
      text-align: center;
      color: #fff;
      text-shadow: 2px 2px 0 #333;
    }
  }
  .bottom{
    font-size: 0.12rem;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    line-height: 20px;
    padding: 0px 20px;
    width: 100%;
    box-sizing:border-box;
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 0 #333;
  }
</style>